/**
 * 主体内容组件
 * Created by yuzhou on 16/9/12.
 */


define([
    'vue','debug', 'text!tpl/main.html',
    'components/mainHeader',
    'components/mainSideBar',
    'components/goToTop'
], function(Vue, Debug, mainHtml, MainHeader, MainSideBar, GoToTop) {

    var debug = Debug('App:Main')

    return Vue.extend({
        template: mainHtml,
        components: {
            'main-header': MainHeader,
            'main-side-bar': MainSideBar,
            'go-to-top': GoToTop
        },
        route: {
            activate: function(transition){
                this.$dispatch('body-class', 'hold-transition skin-blue sidebar-mini')
                transition.next()
            }
        },
        ready: function(){
            debug('Main component is ready')
            $.AdminLTE.layout.activate()
        }
    })
})